package com.yida.gwj.expend.outside.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.yida.gwj.expend.outside.domain.GwjMaintenanceFundsBusinessHouse;
import com.yida.gwj.expend.outside.domain.dto.AllocatedAmountListDTO;
import com.yida.gwj.expend.outside.domain.dto.OwnerCommentsDetailDTO;
import com.yida.gwj.expend.outside.domain.request.AllocatedAmountRequest;
import com.yida.gwj.expend.outside.domain.request.GwjInsertHouseRequest;

/**
 * 业务房屋信息Mapper接口
 *
 * @author lgp
 * @date 2023-02-20
 */
@Mapper
public interface GwjMaintenanceFundsBusinessHouseMapper {
    /**
     * 查询业务房屋信息
     *
     * @param businessHouseId 业务房屋信息主键
     * @return 业务房屋信息
     */
    GwjMaintenanceFundsBusinessHouse selectGwjMaintenanceFundsBusinessHouseByBusinessHouseId(Long businessHouseId);

    /**
     * 查询业务房屋信息列表
     *
     * @param gwjMaintenanceFundsBusinessHouse 业务房屋信息
     * @return 业务房屋信息集合
     */
    List<GwjMaintenanceFundsBusinessHouse> selectGwjMaintenanceFundsBusinessHouseList(GwjMaintenanceFundsBusinessHouse gwjMaintenanceFundsBusinessHouse);

    /**
     * 新增业务房屋信息
     *
     * @param gwjMaintenanceFundsBusinessHouse 业务房屋信息
     * @return 结果
     */
    int insertGwjMaintenanceFundsBusinessHouse(GwjMaintenanceFundsBusinessHouse gwjMaintenanceFundsBusinessHouse);

    /**
     * 新增批量导入基础数据（房屋）
     *
     * @param houses 房屋
     * @return 结果
     */
    int insertGwjMaintenanceFundsBusinessHouseList(List<GwjInsertHouseRequest> houses);

    /**
     * 新增批量导入基础数据（房屋）
     *
     * @param houses 房屋
     * @return 结果
     */
    int insertBatchGwjMaintenanceFundsBusinessHouse(List<GwjMaintenanceFundsBusinessHouse> houses);

    /**
     * 修改业务房屋信息
     *
     * @param gwjMaintenanceFundsBusinessHouse 业务房屋信息
     * @return 结果
     */
    int updateGwjMaintenanceFundsBusinessHouse(GwjMaintenanceFundsBusinessHouse gwjMaintenanceFundsBusinessHouse);

    /**
     * 删除业务房屋信息
     *
     * @param businessHouseId 业务房屋信息主键
     * @return 结果
     */
    int deleteGwjMaintenanceFundsBusinessHouseByBusinessHouseId(Long businessHouseId);

    /**
     * 删除业务房屋信息-通过业务ID
     *
     * @param bizId 业务房屋信息主键
     * @return 结果
     */
    int deleteGwjMaintenanceFundsBusinessHouseByBusinessId(Long bizId);

    /**
     * 批量删除业务房屋信息
     *
     * @param businessHouseIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteGwjMaintenanceFundsBusinessHouseByBusinessHouseIds(Long[] businessHouseIds);

    /**
     * 查询业务房屋信息-通过业务ID
     *
     * @param bizId 业务房屋信息主键
     * @return 业务房屋信息
     */
    GwjMaintenanceFundsBusinessHouse selectGwjMaintenanceFundsBusinessHouseByBusinessId(Long bizId);

    /**
     * 批量更新业务房屋信息
     *
     * @param maintenanceFundsBusinessHouseList 需要删除的数据主键集合
     * @return 结果
     */
    int updateBatchMaintenanceFundsBusinessHouse(@Param("maintenanceFundsBusinessHouseList") List<GwjMaintenanceFundsBusinessHouse> maintenanceFundsBusinessHouseList);

    /**
     * 分摊金额列表
     *
     * @param allocatedAmountRequest
     * @return 业务房屋信息
     */
    List<AllocatedAmountListDTO> allocatedAmountList(AllocatedAmountRequest allocatedAmountRequest);

    /**
     * 分摊金额-未选中房屋列表
     *
     * @param allocatedAmountRequest
     * @return 业务房屋信息
     */
    List<GwjMaintenanceFundsBusinessHouse> selectCancelHouseList(AllocatedAmountRequest allocatedAmountRequest);

    /**
     * 分摊金额-查询房屋用途
     *
     * @return 业务房屋信息
     */
    List<String> selectUseTypeList();

    // ------------------------新增功能区 20230630 hmh start----------------------------------
    /**
     * 根据业务ID和房屋标识码查询房屋数据
     * 
     * @param bizId 业务ID
     * @param houseCode 房屋标识码
     * @return
     */
    public GwjMaintenanceFundsBusinessHouse selectGwjMaintenanceFundsBusinessHouseByBizIdAndHouseCode(@Param("bizId") Long bizId, @Param("houseCode") String houseCode);

    /**
     * 20230705
     * 
     * 批量更新导入房屋数据
     * 
     * @return
     */
    int updateBatchMaintenanceFundsBusinessHouseByBizIdAndHouseCode(List<GwjMaintenanceFundsBusinessHouse> list);

    // ------------------------end-----------------------------------------------------------

    /**
     * 查询业主征求意见房屋信息
     * 
     * @param bizId 业务主键
     * @return
     */
    List<OwnerCommentsDetailDTO> selectOwnerCommentsDetailList(Long bizId);
}
